home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / metkit / setup.exe / EXAMPLES / STRUCT / STRUCT.CPP next >
Encoding:
C/C++ Source or Header  |  1997-06-08  |  919 b   |  37 lines

  1. //  Copyright (C) 1996, 1997 Meta Four Software.  All rights reserved.
  2. //
  3. //  This command-line utility displays the data structure of a datafile
  4. //  created with the MetaKit library as a one-line description.
  5. //
  6. //! rev="$Id: struct.cpp,v 1.8 1997/06/08 10:46:13 jcw Exp $"
  7.  
  8. #include "m4kit.h"
  9.  
  10. #include <stdio.h>
  11.  
  12. #if defined (macintosh)
  13.     #include /**/ <console.h>
  14.     #define d4_InitMain(c,v)    c = ccommand(&v)
  15. #endif
  16.  
  17. /////////////////////////////////////////////////////////////////////////////
  18.     
  19. int main(int argc, char** argv)
  20. {
  21.     #ifdef d4_InitMain
  22.         d4_InitMain(argc, argv);
  23.     #endif
  24.  
  25.     if (argc != 2)
  26.         fputs("Usage: STRUCT datafile", stderr);
  27.     else
  28.     {
  29.         c4_Storage store (argv[1], false);
  30.         puts(store.Description());
  31.     }
  32.         
  33.     return 0;
  34. }
  35.  
  36. /////////////////////////////////////////////////////////////////////////////
  37.